<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <style>
        .page-active {
            color: #ffffff!important;
            border: 1px solid #003e99;
            background-color:#003e99 !important;
        }
    </style>
</head>
<body>
    <nav aria-label="Page navigation pagination-sm">
        <ul class="pagination">
            <li>
                <a href="${pageContext.request.contextPath}/userList?currentPage=1&pageSize=${param.pageSize}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            <c:forEach var="p" begin="1" end="${param.totalPage}">
                <li>
                    <c:choose>
                        <c:when test="${param.currentPage == p}">
                            <a class="page-active" href="${pageContext.request.contextPath}/userList?currentPage=${p}&pageSize=${param.pageSize}">${p}</a>
                        </c:when>
                        <c:otherwise>
                            <a href="${pageContext.request.contextPath}/userList?currentPage=${p}&pageSize=${param.pageSize}">${p}</a>
                        </c:otherwise>
                    </c:choose>
                </li>
            </c:forEach>
            <li>
                <a href="${pageContext.request.contextPath}/userList?currentPage=${param.totalPage}&pageSize=${param.pageSize}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>
</body>
</html>
